package com.m3958.firstgwt.client;

import java.util.HashMap;
import java.util.Map;

import com.google.inject.Singleton;
import com.smartgwt.client.data.Record;

@Singleton
public class TemporaryRecordAndIdHolder {

	private Map<String, Record> lastTouched = new HashMap<String, Record>();
	
	private Map<String, String> lastContainerIds = new HashMap<String, String>();
	
	public void putLastContainerId(String modelName,String id){
		lastContainerIds.put(modelName, id);
	}
	
	public String getLastContainerId(String modelName){
		String id = lastContainerIds.get(modelName);
		if(id == null){
			return "";
		}else{
			return id;
		}
	}

	public void putLastTouched(String modelName,Record r){
		lastTouched.put(modelName, r);
	}
	
	public Record getLastTouched(String modelName){
		return getLastTouched(modelName);
	}
	
}
